import org.springframework.boot.gradle.plugin.SpringBootPlugin

plugins {
    id 'io.freefair.lombok' version '4.1.6' apply false
    id 'org.springframework.boot' version "${springBootStarterWebVersion}" apply false
    id 'io.spring.dependency-management' version '1.0.8.RELEASE'
}

tasks.withType(Javadoc) {
    options.encoding = 'UTF-8'
}

subprojects {
    apply plugin: 'java'
    apply plugin: 'io.spring.dependency-management'
    apply plugin: 'io.freefair.lombok'

    sourceCompatibility = javaTargetVersion
    targetCompatibility = javaTargetVersion

    repositories {
        mavenLocal()
        mavenCentral()
    }

    dependencyManagement {
        imports {
            mavenBom(SpringBootPlugin.BOM_COORDINATES)
            mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudReleaseTrainVersion}"
        }
        dependencies {
            dependency "io.springfox:springfox-swagger2:${springFoxSwaggerVersion}"
            dependency "io.springfox:springfox-swagger-ui:${springFoxSwaggerVersion}"
        }
    }

    dependencies {
        testImplementation 'org.junit.jupiter:junit-jupiter-api'
        testImplementation 'org.junit.jupiter:junit-jupiter-params'
        testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
        testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.5.1'
    }

    test {
        useJUnitPlatform()
    }
}